﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Ricciolo.StylesExplorer.Model;
using System.ComponentModel;

namespace Ricciolo.StylesExplorer.Controls
{
    class ApplicationTreeNode : TreeNode, ITreeNodeChildren
    {
        private IApplication _application;

        public ApplicationTreeNode(IApplication app)
        {
            this._application = app;
            this.Text = app.Name;
            this.ImageKey = "Application";
            this.SelectedImageKey = this.ImageKey;
        }

        public IApplication Application
        {
            get { return _application; }
        }

        #region ITreeNodeChildren Members

        System.ComponentModel.IBindingList ITreeNodeChildren.Children
        {
            get { return _application.Assemblies as IBindingList; }
        }

        #endregion
    }
}
